1. Field of the Invention
The present invention relates to a memory management method, a storage device, and a computer equipped with the storage device.
2. Description of Related Art
As auxiliary storage devices of information equipment, in general, magnetic disc storage devices have extensively been used. However, in recent years, the magnetic disc storage devices are increasingly replaced with storage devices having a semiconductor memory as a storage medium. Among the storage devices, a storage device using a flash memory which is a sort of electrically erasable programmable read only memories (EEPROM) becomes mainstream.
The flash memory is excellent in read and write speeds as compared with a magnetic disc. On the other hand, the flash memory suffers from such a problem that when the number of writes and the number of reads are increased, data internally saved is changed, and an error is generated.
For that reason, in the storage device using the flash memory, an error correction circuit is frequently disposed within a controller so as to allow errors up to a given number. Also, in order to ensure the reliability, a spare area is provided in addition to a data retention area, and if a given number or more of errors is generated, the data retention area is discarded, and the spare area is used instead. However, when this method is used, if the errors are frequently generated, the spare area is rapidly lost, and an operating time of the storage device may be shortened.
The background art of the storage device using the flash memory is disclosed in JP-A-2010-86404. In order to prevent the spare area from being rapidly, reduced by the error, there is a disclosure in JP-A-2010-86404 that “An error correction circuit and a block management means are provided in a flash memory device, and after the remaining number of spare blocks reaches a threshold value set in the block management means, data having a bit error is error-corrected, and transmitted to a host, and a block in which the errors are generated is refreshed. The refreshment is executed by transcribing all data including the error-corrected data in that block into a free block or a spare block, and erasing the data in the original block. Alternatively, the refreshment is executed by writing back the data on the original block after transcribing all data into the free block or the spare block.”
In JP-A-2010-86404, if the number of spare blocks becomes smaller than a given number, a block in which the number of errors is smaller than a threshold value 2 (6 bits) is refreshed, and replaced with the free block or the spare block. However, in this method, if the number of spare blocks is equal to or larger than the given number, the block is not refreshed, and a block in which the number of errors is equal to or larger than the threshold value 1 (4 bits) but smaller than the threshold value 2 is discarded as a fault block. For that reason, the number of refreshable blocks is small, and the effect of prolonging the operating time is small.